package guet.dream.tianyaclub;

import guet.dream.common.freemarker.BaseControllerServlet;
import guet.dream.common.freemarker.Page;
import guet.dream.tryftl.Book;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

public class IndexAction extends AbstractBaseAction{

	private ArrayList<Book> books = new ArrayList<Book>();
	
	public void indexAction(HttpServletRequest request){
		List snapShot;
		Book book = new Book("java in action","banxi1988");
		books.add(book);
		books.add(new Book("Hibernate in Action ","Gavin King"));
		books.add(new Book("Test Driven Development","iyan"));
		books.add(new Book("CSS:The Definitive Guide","Eric A.Meyer"));
		//synchronized(books){
		//	snapShot = (List)books.clone();
		//}
		page.put("books", books);
		page.setTemplate("index.ftl");
	}
}
